<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--按钮点击时调用方法-->
<input type="button" value="按钮" onclick="f1()">
<script>
    //无参无返回值
    function f1() {
        alert("f1");
    }
    //调用方法
    // f1();
    //有参无返回值
    function f2(name,age) {
        alert(name+":"+age)
    }
    // f2("刘备",50)

    //无参有返回值
    function f3() {
        return "我是返回值";
    }
    let info = f3();
    alert(info);
    //有参有返回值
    function f4(x,y) {
        return x*y
    }
    let result = f4(5,9);
    alert(result)

</script>
</body>
</html>